<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="base/layout.html">

    <!-- start: Content -->
    <div layout:fragment="content" class="main sidebar-minified">

        <div class="row">
            <div class="col-lg-12">
                <ol class="breadcrumb">
                    <li><i class="fa fa-home"></i><a href="index.html">首页</a></li>
                    <li><i class="fa fa-table"></i>房屋管理</li>
                </ol>
            </div>
        </div>
        <div class="row">


            <div class="col-lg-3 col-sm-6 col-xs-6 col-xxs-12">
                <div class="smallstat teal-bg">
                    <i class="fa fa-bell white-bg"></i>
                    <a th:href="@{../houses/toAdd}"><span class="value black">添加信息</span></a>
                    <span class="title">用来添加房屋信息</span>
                </div><!--/.smallstat-->

                <form id="modularForm" th:action="@{../students/student}"  method="post" enctype="multipart/form-data" class="form-horizontal ">
                    <label class="col-md-3 control-label" for="text-input">房屋</label>
                    <input type="text" id="text-input" name="name" class="form-control" placeholder="房屋">
                    <input type="text"   class="form-control" th:value="${session.username}">
                    <button id="submitBtn" type="submit" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 查询</button>
                </form>
            </div><!--/.col-->

        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h2><i class="fa fa-table red"></i><span class="break"></span><strong>房屋管理</strong></h2>
                        <div class="panel-actions">
                            <a href="table.html#" class="btn-setting"><i class="fa fa-rotate-right"></i></a>
                            <a href="table.html#" class="btn-minimize"><i class="fa fa-chevron-up"></i></a>
                            <a href="table.html#" class="btn-close"><i class="fa fa-times"></i></a>
                        </div>
                    </div>
                    <div class="panel-body">
                        <table class="table table-striped table-bordered bootstrap-datatable datatable">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>地址</th>
                                <th>房产证号</th>
                                <th>户型</th>
                                <th>建筑面积</th>
                                <th>建造年份</th>
                                <th>产权类型</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>



                                <tr th:each="house,userStat  : ${houseList}">
                                    <td th:text="${userStat.index+1}"></td>
                                    <td th:text="${house.address}"></td>
                                    <td th:text="${house.houseNumber}"></td>
                                    <td th:text="${house.flooPlan}"></td>
                                    <td th:text="${house.area}"></td>
                                    <td th:text="${house.buildYear}"></td>
                                    <td th:text="${house.propertyType}"></td>

                                    <td>
                                        <a class="btn btn-success"  th:onclick="'layerOpen(\'toDetail?id='+${house.id}+'\')'">
                                            <i class="fa fa-search-plus "></i>
                                        </a>
                                        <a class="btn btn-info"th:href="@{../houses/toUpdate(id=${house.id})}">
                                            <i class="fa fa-edit "></i>
                                        </a>
                                        <a class="btn btn-danger" th:onclick="'deleteHouse('+${house.id}+')'">
                                            <i class="fa fa-trash-o "></i>

                                        </a>
                                    </td>

                                </tr>








                            </tbody>
                        </table>

                        <!-- 分页 -->

                        <div th:replace="base/pagination :: pagination('house')"></div>
                    </div>
                </div>
            </div><!--/col-->

        </div><!--/row-->



        <script>
            function deleteHouse(id) {
                $.ajax({
                    url:'delete',
                    type:'get',
                    data:'id='+id,
                    success:function () {

                        layer.msg("删除成功!");
                        location.reload();
                    }
                })
            }




        </script>




    </div>
    <!-- end: Content -->






